<?php

use Phalcon\Di;
use Phalcon\Di\FactoryDefault;
use Phalcon\Loader;

ini_set("display_errors", 1);
error_reporting(E_ALL);

define("ROOT_PATH", __DIR__);

set_include_path(
    ROOT_PATH . PATH_SEPARATOR . get_include_path()
);

include __DIR__ . "/../vendor/autoload.php";

$loader = new Loader();

$loader->registerDirs(
    [
        ROOT_PATH
    ]
);

$loader->registerNamespaces(
	[
		'App' => ROOT_PATH . '/../app/',
		'App\Models' => ROOT_PATH . '/../app/Models',
		'Firebase\\JWT' => ROOT_PATH . '/../vendor/firebase/php-jwt/src',
		'Rootwork' => ROOT_PATH . '/../vendor/rootwork/phalcon-jwt/src',
	]
);

$loader->register();

$di = new FactoryDefault();

Di::reset();

// Add any needed services to the DI here

Di::setDefault($di);